<template>
	<page-body>
		<view class="page">
			<view class="flex benben-position-layout flex flex-wrap align-center wtxq_flex_0_higd"
				:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
				<view class='flex flex-wrap align-center justify-between flex-sub wtxq_fd0_0_higd'>
					<view class='flex flex-wrap align-center wtxq_fd0_0_c0_higd' @tap.stop="handleJumpDiy"
						data-type="back" data-url="1">
						<text class='fu-iconfont2  wtxq_fd0_0_c0_c0_higd'>&#xE794;</text>
					</view>
					<view class='flex flex-wrap align-stretch justify-center'>
						<text  class='wtxq_fd0_0_c1_c0_higd'>{{type==1?'巡更详情':'问题详情'}}</text>
						<!-- <text class='wtxq_fd0_0_c1_c0_higd' v-if=" type=='1'">{{$t('巡更详情')}}</text><text
							class='wtxq_fd0_0_c1_c0_higd' v-if=" type=='2'">{{$t('问题详情')}}</text><text
							class='wtxq_fd0_0_c1_c0_higd' v-if=" type=='3'">{{$t('问题审核')}}</text> -->
					</view>
					<view class='flex flex-wrap align-center justify-end xgxq_fd0_0_c0_higd'>
						<!-- #ifndef MP-WEIXIN -->
						<text @tap.stop="saoFunc" v-if=" type=='1'"
							class='fu-iconfont2  xgxq_fd0_0_c2_c0_higd'>&#xe6e4;</text>
						<!-- #endif -->

					</view>
				</view>

			</view>
			<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
			<view class="saomabox flex flex-direction" v-if="showScanner" @click="showScanner =false">
							<view id="reader" class="scan-container " ></view>
						</view>
			<!---flex布局flex布局开始-->
			<view class="flex flex-direction align-stretch benben-flex-layout">
				<view class='flex flex-direction align-stretch wtxq_fd1_0_higd'>
					<view class='flex flex-direction align-stretch wtxq_fd1_0_c0_higd'>
						<view class='flex flex-wrap align-center wtxq_fd1_0_c0_c0_higd'>
							<text>{{$t('巡更路线：')}}</text>
							<text>{{info.info.rcxglx_xglxmc}}</text>
						</view>
						<view class='flex flex-wrap align-center wtxq_fd1_0_c0_c1_higd' v-if=" type=='2'">
							<!-- <image class='wtxq_fd1_0_c0_c1_c0_higd' mode="aspectFit" :src='STATIC_URL+"102.png"'
								v-if=" info.info.zg_status=='1'"></image>
							<image class='wtxq_fd1_0_c0_c1_c0_higd' mode="aspectFit" :src='STATIC_URL+"103.png"'
								v-if=" info.info.zg_status=='2'"></image>
							<image class='wtxq_fd1_0_c0_c1_c0_higd' mode="aspectFit" :src='STATIC_URL+"104.png"'
								v-if=" info.info.zg_status=='3'"></image>
							<text class='wtxq_fd1_0_c0_c1_c1_higd'
								v-if=" info.info.zg_status=='1'">{{$t('待整改')}}</text><text
								class='wtxq_fd1_0_c0_c1_c1_1_higd'
								v-if=" info.info.zg_status=='2'">{{$t('整改中')}}</text><text
								class='wtxq_fd1_0_c0_c1_c1_1_higd' v-if=" info.info.zg_status=='3'">{{$t('已完成')}}</text> -->
						</view>
						<view class='flex flex-wrap align-center wtxq_fd1_0_c0_c2_higd' v-if=" type=='1'">
						<!-- 	<image class='wtxq_fd1_0_c0_c1_c0_higd' mode="aspectFit" :src='STATIC_URL+"102.png"'
								v-if=" info.info.status=='1'"></image>
							<image class='wtxq_fd1_0_c0_c1_c0_higd' mode="aspectFit" :src='STATIC_URL+"103.png"'
								v-if=" info.info.status=='2'"></image>
							<image class='wtxq_fd1_0_c0_c1_c0_higd' mode="aspectFit" :src='STATIC_URL+"104.png"'
								v-if=" info.info.status=='3'"></image>
							<text class='wtxq_fd1_0_c0_c1_c1_higd'
								v-if=" info.info.status=='1'">{{$t('未开始')}}</text><text
								class='wtxq_fd1_0_c0_c1_c1_1_higd' v-if=" info.info.status=='2'">{{$t('巡更中')}}</text>
							<text class='wtxq_fd1_0_c0_c1_c1_1_higd' v-if=" info.info.status=='3'">{{$t('已完成')}}</text> -->
						</view>
						<view class='flex flex-wrap align-center wtxq_fd1_0_c0_c3_higd'>
							<text class='wtxq_fd1_0_c0_c3_c0_higd'>{{$t('巡更点数量')}}</text>
							<!-- <text class='wtxq_fd1_0_c0_c3_c1_higd'>{{info.info.num}}</text>
							<text class='wtxq_fd1_0_c0_c3_c1_higd'>/</text> -->
							<text class='wtxq_fd1_0_c0_c3_c1_higd'>{{info.info.total_num}}</text>
						</view>
						
					</view>
				</view>
				<view class='flex flex-direction align-stretch wtxq_fd1_1_higd'>
					<view class='flex flex-wrap align-center wtxq_fd1_1_c0_higd'>
						<text class='wtxq_fd1_1_c0_c0_higd' v-if=" type=='1'">{{$t('巡更点')}}</text><text
							class='wtxq_fd1_1_c0_c0_higd' v-if=" type=='2'">{{$t('专项检查项')}}</text><text
							class='wtxq_fd1_1_c0_c0_higd' v-if=" type=='3'">{{$t('隐患排查项')}}</text>
						<!-- #ifdef MP-WEIXIN -->
						<text @tap.stop="saoFunc" v-if=" type=='1'" style="margin: 0 32rpx 0 auto;"
							class='fu-iconfont2  xgxq_fd0_0_c2_c0_higd'>&#xe6e4;</text>
						<!-- #endif -->
					</view>
					<view class='flex flex-direction align-stretch'>
						<template v-for='(item,key0) in info.list'>
							<view class='flex flex-direction align-stretch wtxq_fd1_1_c1_c0_higd'
								@tap.stop="jumpFunc(item)" :key='key0'>
								<view class='flex flex-wrap align-center justify-between wtxq_fd1_0_c0_c3_higd'>
									<view class='flex flex-wrap align-center'>
										<text>{{item.xgmc}}</text>
									</view>
									<view class='flex flex-wrap align-center'>
										<view class='flex flex-wrap align-center wtxq_fd1_1_c1_c0_c0_c1_c0_higd'
											v-if=" type=='1'">
											<text class='numbers'
												v-if=" item.status=='2'">巡更{{item.num}}次</text>
											<!-- <text class='wtxq_fd1_1_c1_c0_c0_c1_c0_c0_higd'
												v-if=" item.status=='1'">{{$t('未巡更')}}</text><text
												class='wtxq_fd1_1_c1_c0_c0_c1_c0_c0_1_higd'
												v-if=" item.status=='2'">{{$t('已巡更')}}</text> -->
										</view>
										<view class='flex flex-wrap align-center wtxq_fd1_1_c1_c0_c0_c1_c0_higd'
											v-if=" type=='2'">
											<!-- <text class='wtxq_fd1_1_c1_c0_c0_c1_c1_c0_higd'
												v-if=" item.wtzt=='1'">{{$t('待整改')}}</text><text
												class='wtxq_fd1_1_c1_c0_c0_c1_c1_c0_1_higd'
												v-if=" item.wtzt=='2'">{{$t('已完成')}}</text> -->
										</view>
										<!--     <view   class='flex flex-wrap align-center wtxq_fd1_1_c1_c0_c0_c1_c0_higd'    v-if= " type=='3'"  >
        <text class='wtxq_fd1_1_c1_c0_c0_c1_c2_c0_higd'    v-if= " item.wtzt=='1'"  >{{$t('待审核')}}</text><text class='wtxq_fd1_1_c1_c0_c0_c1_c2_c0_1_higd'    v-if= " item.wtzt=='2'"  >{{$t('已完成')}}</text>
</view>
 --><text class='fu-iconfont2'>&#xe7f2;</text>
									</view>
								</view>
								<view class='flex flex-wrap align-center wtxq_fd1_1_c1_c0_c1_higd'>
									<text class='wtxq_fd1_1_c1_c0_c1_c0_higd'>{{item.address}}</text>
								</view>
							</view>
						</template>

					</view>
				</view>
			</view>

			<!---flex布局flex布局结束-->
			<!--    <view class="flex flex-wrap align-center justify-center benben-position-layout flex wtxq_flex_2_higd"    >
        <button class='wtxq_fd2_0_higd'   >{{$t('完成巡更')}}</button>

        </view> -->
			<view :style="{height: '88rpx'}"></view>


		</view>
	</page-body>
</template>
<script>
	import {
		Html5Qrcode,
		Html5QrcodeSupportedFormats
	} from 'html5-qrcode'
	import {
		validate
	} from '@/common/utils/validate.js'
	import wx from 'weixin-js-sdk'
	export default {
		components: {},


		data() {
			return {
				/** zg_status【问题状态】 **/
				"info": {
					/** zg_status【问题状态】 **/
					"info": {
						"aid": "",
						"rcxglx_xglxmc": "",
						"status": "",
						"rcxglx_xgsc": "",
						"xgfs": "",
						"status_name": "",
						"zg_status": "",
						"total_num": "",
						"num": ""
					},
					"list": []
				},
				"aid": "",
				"status": "",
				"title": "",
				"address": "",
				"qy": "",
				/** xgdid【巡更点id】 **/
				"xgdid": "",
				/** xgjgid【巡更结果id】 **/
				"xgjgid": "",
				"id": "1",
				"type": "",
				showScanner: false,
			    html5Qrcode: null,
				currentDomain:'',
				configuredDomain:'',
				retryCount:0,
			};
		},
		computed: {

		},
		watch: {},
		onLoad(options) {
			let {
				id,
				type
			} = options
			if (id !== undefined) this.id = id
			if (type !== undefined) this.type = type
			this.getinfoFunc()
			this.diyPageListen()
			this.getWxConfig()
		},
		onUnload() {
			this.diyOffPageListen()
		},
		onReady() {

		},
		onShow() {

		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {

		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		},
		methods: {
			// 从后端获取配置信息
				async  getWxConfig() {
					// 在跳转到要分享的页面时，不用pushState，在Vuerouter中就是不用push方式跳转，方式如下：window.location.href=要跳转的链接//_this.Srouter.push（t//../1)）
					// 既然SPA在微信中只认第一个页面的path，那我们就在第一次进入页面时记录下path，其他页面用这个path。我们在App.vue或者mainjs中记录下这个path：
					

					// 然后在需要分享的页面，使用这个path：
					const systemInfo = uni.getSystemInfoSync();
					let url=window.location.href.split('#')[0]
					if(systemInfo.platform === 'ios' && uni.getStorageSync('firstEntryUrl')){
						url=uni.getStorageSync('firstEntryUrl').split('#')[0]
					}
					// console.log(url)
					// console.log(11111111111111)
					// console.log(uni.getStorageSync('WXInfo'))
					let wxinfo={}
					
					
					let href=systemInfo.platform === 'ios'?url:location.href
					this.currentDomain=href
					let info = await this.$api.post(global.apiUrls.post68d5fb8d1dedf, {
						href:href
						// aid: this.course
					});
					console.log(info)		
					if (info.data.code == 1) {
						// uni.setStorageSync('WXInfo',info.data.data)
							wxinfo=info.data.data
					}
					
					  console.log(wxinfo)
				  // 首先需要配置微信JS-SDK
					  wx.config({
						debug: false, // 生产环境设为false
						appId: 'wx74f50709fdcfd292',
						timestamp: wxinfo.timestamp,
						nonceStr:wxinfo.nonceStr,
						signature: wxinfo.signature,
						jsApiList: [
						  'scanQRCode' // 必须将scanQRCode添加到jsApiList中
						]
					  });
				},
			//查询日常巡更详情
			async getyo7384f264a386Func() {
				//请求方法
				//数据验证

				let datainfo = await this.$api.get(global.apiUrls.post67384f264a386, {
					rcxglx_id: this.id
				});

				if (datainfo.data.code != 1) {
					this.$message.info(datainfo.data.msg);
					return
				}
				let infoinfo = datainfo.data;
				this.info = infoinfo.data

			},
			//跳转页面
			jumpFunc(item) {
				this.status = this.type == 1 ? item.status : item.wtzt
				//1未巡更 2已巡更   	item.status
				//1待整改2已完成item.wtzt
				this.qy = item.xgmc
				this.address = item.address
				this.aid = item.aid
				this.xgdid = item.rcxgd_id
				this.title = this.info.info.rcxglx_xglxmc
				
				// 巡更完成的
				if (this.type == 1 && item.status == 2 && (item.xgjg == 2 || item.xgjg == 1)) {
					//item.status 2 已巡更  item.xgjg 1正常 2异常
					this.aid = item.xgjg_id
				}
				this.xgjg_id = item.xgjg_id//巡更结果id
				console.log('aid' + this.aid)
				console.log('title' + this.title)
				console.log('qy' + this.qy)
				console.log('status' + this.status)
				console.log('address' + this.address)


				if (this.type == '1') {
					// 巡更
					if (this.status == '1') {
						this.$message.info('请扫码巡更')
						return
						this.$urouter.navigateTo(
							`/pagercxg/rcksxg/rcksxg?id=${this.aid}&address=${this.address}&qy=${this.qy}&title=${this.title}`
						);
					} else {
						this.$urouter.navigateTo(`/pagercxg/rcxgover/rcxgover?id=${this.aid}&title=${this.title}&rcxgd_id=${item.rcxgd_id}&rcxglx_id=${this.info.info.rcxglx_id}`);
					}
				} else {
					if(item.xgjg == 1){
						this.$urouter.navigateTo(`/pagercxg/rcxgover/rcxgover?id=${this.aid}&title=${this.title}&rcxgd_id=${item.rcxgd_id}&rcxglx_id=${this.info.info.rcxglx_id}`);
						return
					}
					// 整改
					if (this.status == '1') {
						// 异常 去整改
						this.$urouter.navigateTo(
							`/pagercxg/rcwtzg/rcwtzg?id=${this.xgdid}&title=${this.title}&ids=${this.aid}`);
					} else {
						// 已整改
						this.aid = item.aid
						this.$urouter.navigateTo(
							`/pagercxg/rczgover/rczgover?id=${this.aid}&title=${this.title}&ids=${this.aid}`);
					}
				}
			},
			async saoFunc() {
				// if (!this.info.info.sjkssj) {
				// 	this.$message.info('请先点击开始巡更')
				// 	return
				// }
				let _this = this
				console.log('扫')
				
				// this.getxg('2705043')
				// return
				wx.ready(function() {
				  // 配置成功后调用扫一扫
				  setTimeout(() => {
				      wx.scanQRCode({
						needResult: 1, // 默认为0，扫描结果由微信处理，1则直接返回扫描结果
						onlyFromCamera:true,//只允许相机
						// scanType: ["qrCode"], // 可以指定扫二维码还是一维码，默认二者都有
						success: function (res) {
						  // 当needResult 为 1 时，扫码返回的结果
						  const result = res.resultStr; 
						  // console.log('扫描结果:', result);
										  let code = JSON.parse(res.resultStr).qrCode
						  // alert('扫描结果: ' + code);
										   _this.getxg(code)
						},
						fail: error=> {
							// alert('扫描失败，请检查配置和权限: ' + JSON.stringify(error));
							// alert('扫描失败，请检查配置和权限: ' + typeof(error));
							// alert('扫描失败，: ' + JSON.stringify(error).errMsg);
							// alert(JSON.stringify(error).errMsg.indexOf('offline verifying'))
							// alert( _this.retryCount)
							 if ( _this.retryCount < 3) {
								 _this.getWxConfig()
								 _this.retryCount++;
								 // 延迟一段时间后重试
								 setTimeout(_this.saoFunc, 500);
							 } else {
								// 提示用户刷新页面
								uni.showToast({ title: '扫码调用失败，请刷新页面后重试！', icon: 'none' })
							 }
							 // alert('扫描失败，请检查配置和权限: ' + JSON.stringify(error));
						  // alert('扫描失败，请重试');
						}
				      });
				    }, 800); // 关键延迟
				});
				return 
				if (uni.getSystemInfoSync().uniPlatform == 'web') {
					this.startWebScan()
					return
				}
				
				uni.scanCode({
					onlyFromCamera: true,
					success: function(res) {
						console.log(res)
					},
					complete: function(res) {
						uni.showLoading({
							'title': '识别中...'
						});
						setTimeout(function() {
							uni.hideLoading();
						}, 1000);
						if (res.result) {
							console.log(res.result)
							console.log(typeof(res.result))
							console.log(JSON.parse(res.result).qrCode)
							let code = JSON.parse(res.result).qrCode
							_this.getxg(code)

						} else {
							setTimeout(function() {
								uni.hideLoading();
							}, 800);
						}
					},
					fail: function(res) {
						setTimeout(function() {
							uni.hideLoading();
						}, 800);
					}
				})
			},
			// 初始化扫码器
			   initScanner() {
			     return new Promise((resolve, reject) => {
			       // 确保DOM已更新
			       this.$nextTick(() => {
			         const element = document.getElementById("reader");
			         if (!element) {
			           reject(new Error("扫码容器未找到"));
			           return;
			         }
			         
			         this.html5Qrcode = new Html5Qrcode("reader");
			         resolve();
			       });
			     });
			   },
			// 开始Web端扫码
			async startWebScan() {
			  try {
			    // 显示扫码容器
			    this.showScanner = true;
			    
			    // 确保扫码器初始化完成
			    await this.initScanner();
			    
			    const qrCodeSuccessCallback = (decodedText) => {
			      this.handleScanResult(decodedText);
			      this.stopWebScan();
			    };
				// 宽高比（可选） aspectRatio: 1.0, // 1.0表示1:1，1.77表示16:9
				// 帧率 fps（每秒扫描次数）
			    const config = { fps: 10, qrbox: 250 };
				 // const config = { fps: 10, qrbox: 250, aspectRatio:2.0  };加上扫描范围变小了
				 // const config = { fps: 20, qrbox: 250,aspectRatio:1.77   }; 
				  // const config = { fps: 30, qrbox:{ width: 250, height: 250 },aspectRatio:1   }; 
				  // const config = { fps: 10, qrbox:{ width: 200, height: 200 },aspectRatio:1.0   }; 
				   // const config = { fps: 30, qrbox:{ width: 200, height: 200 },aspectRatio:1.0   }; 
				   // const config = { fps: 30, qrbox:{ width: 200, height: 200 },aspectRatio:3.0   };放大了 但是不显示扫描狂
				    // const config = { fps: 30, qrbox:{ width: 600, height: 200 },aspectRatio:3.0   };
					// const config = {
					//   fps: 5, // 低帧率
					//   qrbox: (width, height) => {
					//     return { width: width * 0.8, height: height * 0.8 }; // 大区域
					//   }
					// };
					// const config = {
					//     fps: 10,
					// 	qrbox:{ width: 250, height: 250 },
					//     videoConstraints: {
					//         width: { ideal: 250 },
					//         height: { ideal: 250 },
					//         facingMode: "environment" // 优先使用后置摄像头
					//     }
					// };
					// const config = { fps: 30, qrbox:{ width: 600, height: 600 },aspectRatio:1.0   };
					 // const config = { fps: 30, qrbox:{ width: 600, height: 600 },aspectRatio:1.77   };
					 // const config = { fps: 30, qrbox:{ width: 600, height: 600 },aspectRatio:0.56  };
					 // const config = { fps:5, qrbox:{ width: 30, height: 10 },aspectRatio:3.0  };
					 // const config = { fps:5, qrbox:{ width: 300, height: 100 },aspectRatio:3.0  };
					 // 根据屏幕尺寸动态计算
					// const config  ={
					// 		fps:5,
					// 	  qrbox: { width: 200, height: 200 }, // 真正放大：增加面积
					// 	   aspectRatio: 1.0,
					// 		// videoConstraints: {
					// 		//    zoom: 2.0 ,// 2倍光学变焦 
					// 		//    facingMode: "environment" // 优先使用后置摄像头
					// 	 //     },
					// 		 // digitalZoom: 1.5
					//  }
					 // const config = { fps:5, qrbox:{ width: 400, height:200 },aspectRatio:2.0  };
					// html5Qrcode.start(/* elementId */, config, /* successCallback */, /* errorCallback */);
			   // const config = {
						// fps: 30, // 提高帧率
						// qrbox: {
						//   width: 200,  // 减小扫码区域，提高速度
						//   height: 200
						// },
						// aspectRatio: 1.0,
						// disableFlip: true // 禁用图像翻转，提高性能
					 //  };
					 // const config = {
					 //   fps: 10,
					 //   qrbox: (viewfinderWidth, viewfinderHeight) => {
					 //     // viewfinderWidth: 视频流的宽度
					 //     // viewfinderHeight: 视频流的高度
					 //     const size = Math.min(viewfinderWidth, viewfinderHeight) * 0.6;
					 //     return {
					 //       width: size,
					 //       height: size
					 //     };
					 //   }
					 // };
				// const config = { fps: 20,qrbox: { width: 250, height: 250 },  aspectRatio:2.0 }; 
				// const config = { fps: 10,qrbox: { width: 250, height: 250 },  aspectRatio:2.0 };
				// const config ={
				// 	  fps: 30,
				// 	  qrbox: { width: 250, height: 250 }, // 非常小的扫码区域
				// 	  aspectRatio:2.0
				// };
			   
			    await this.html5Qrcode.start(
			      { facingMode: "environment" },
			      config,
			      qrCodeSuccessCallback
			    );
			  } catch (err) {
			    console.error("扫码错误:", err);
			    this.stopWebScan();
			    console.log(err)
			    // 回退到模拟扫码
			  //   if (err.message.includes("NotAllowedError")) {
			  //     uni.showToast({ title: '请允许摄像头权限', icon: 'none' });
			  //   } else {
					// return
			  //     this.showWebScanMock();
			  //   }
				if (error.includes('NotAllowedError')) {
				  uni.showToast({ title: '请允许摄像头权限', icon: 'none' });
				} else if (error.includes('NotFoundError')) {
				  uni.showToast({ title: '未找到摄像头', icon: 'none' });
				  // this.showWebScanMock();
				} else {
				  uni.showToast({ title: '扫码功能暂不可用', icon: 'none' });
				  // this.showWebScanMock();
				}
			  }
			},
			
			// 停止Web端扫码
			stopWebScan() {
			  if (this.html5Qrcode) {
			    this.html5Qrcode.stop().then(() => {
			      this.html5Qrcode.clear();
			      this.showScanner = false;
			    }).catch(err => {
			      console.error("停止扫码失败:", err);
			      this.showScanner = false;
			    });
			  } else {
			    this.showScanner = false;
			  }
			},
			
			// 扫码主方法
			scanCode() {
			  // #ifdef APP-PLUS
			  uni.scanCode({
			    success: (res) => this.handleScanResult(res.result),
			    fail: (err) => uni.showToast({ title: '扫码失败', icon: 'none' })
			  });
			  // #endif
			  
			  // #ifdef H5
			  this.startWebScan();
			  // #endif
			},
			
			// Web端模拟扫码
			showWebScanMock() {
			  uni.showModal({
			    title: '模拟扫码',
			    content: '在Web端无法直接扫码，请输入扫码内容',
			    editable: true,
			    success: (res) => {
			      if (res.confirm && res.content) {
			        this.handleScanResult(res.content);
			      } 
			    }
			  });
			},
			
			// 处理扫码结果
			handleScanResult(result) {
			  let code = JSON.parse(result).qrCode
			   // uni.showToast({ title: `扫码成功: ${code}`, icon: 'none' });
			   this.showScanner=false
			   this.getxg(code)
			  // 这里处理扫码结果逻辑
			},
			// 获取巡更信息
			async getxg(code) {
				let datalist = await this.$api.get(global.apiUrls.post685261f007bdc, {
					qr_code: code,
					rcxglx_id:this.info.info.rcxglx_id,//巡更路线id
				});
				console.log(datalist)
				if (datalist.data.code != 1) {
					this.$message.info(datalist.data.msg);
					return
				}
				let infolist = datalist.data.data;
				console.log(infolist)
				if (infolist) {
					// if (infolist.is_xungeng == 2) {
					// 	this.$message.info('此巡更点您已巡更完毕')
					// 	return
					// }
					this.$urouter.navigateTo(
						`/pagercxg/rcksxg/rcksxg?id=${infolist.xgxq_id}&address=${infolist.xgmc}&qy=${infolist.address}&title=${infolist.lx_name}&rcxgd_id=${infolist.aid}&rcxglx_id=${this.info.info.rcxglx_id}`
						);
				} else {
					uni.showModal({
						title: '此巡更任务不包含此巡更点',
						duration: 3000,
					})

				}

			},
			//跳转巡更
			xg() {
				this.$urouter.navigateTo(
					`/pagercxg/rcksxg/rcksxg?id=${this.aid}&address=${this.address}&qy=${this.qy}&title=${this.title}`
				);
			},

			//获取数据
			getinfoFunc() {
				console.log(this.type)
				console.log(6666666)
				if (this.type == '1') {
					this.getyo7384f264a386Func()
				} else {
					this.getxm848e5585b408Func()
				}
			},
			//查询日常巡更-问题整改
			async getxm848e5585b408Func() {
				//请求方法
				//数据验证

				let datainfo = await this.$api.get(global.apiUrls.post6848e5585b408, {
					rcxglx_id: this.id
				});

				if (datainfo.data.code != 1) {
					this.$message.info(datainfo.data.msg);
					return
				}
				let infoinfo = datainfo.data;
				this.info = infoinfo.data

			},
			//页面监听
			diyPageListen() {
				uni.$on('tjrcxg', (data) => {
					this.getyo7384f264a386Func()
				});
				uni.$on('tjrczg', (data) => {
					this.getinfoFunc()
				});
			},
			//注销页面监听
			diyOffPageListen() {
				uni.$off('tjrcxg');
				uni.$off('tjrczg');
			}
		}
	};
</script>
<style lang="scss" scoped>
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background: #F8F8F8;
		background-size: 100% auto;

		.wtxq_flex_2_higd {
			width: 750rpx;
			height: 88rpx;
			overflow: hidden;
			z-index: 10;
			bottom: calc(88rpx + var(--window-bottom));

			.wtxq_fd2_0_higd {
				border-radius: 33rpx 33rpx 33rpx 33rpx;
				width: 686rpx;
				line-height: 88rpx;
				font-size: 32rpx;
				background: #D32A29;
				color: #fff;
				height: 88rpx;
			}
		}

		.wtxq_fd1_0_higd {
			width: 100%;
			padding: 16rpx 32rpx 16rpx 32rpx;

			.wtxq_fd1_0_c0_higd {
				background: rgba(255, 255, 255, 1);
				background-size: 100% auto;
				border-radius: 16rpx;
				padding: 0rpx 24rpx 0rpx 24rpx;
				color: rgba(153, 153, 153, 1);
				font-size: 28rpx;
				position: relative;

				.wtxq_fd1_0_c0_c0_higd {
					font-size: 32rpx;
					font-weight: 500;
					color: #333;
					margin: 24rpx 0rpx 24rpx 0rpx;
				}

				.wtxq_fd1_0_c0_c1_higd {
					position: absolute;
					z-index: 2;
					width: 116rpx;
					height: 48rpx;
					right: 0rpx;
					font-size: 24rpx;
					color: var(--benbenFontColor3);
					text-align: center;
				}

				.wtxq_fd1_0_c0_c2_higd {
					position: absolute;
					z-index: 2;
					width: 116rpx;
					height: 48rpx;
					right: 0rpx;
					color: var(--benbenFontColor3);
					font-size: 24rpx;
					text-align: center;
				}
			}
		}

		.wtxq_fd1_0_c0_c1_c0_higd {
			width: 116rpx;
			height: 48rpx;
			border-radius: 0rpx;
			position: absolute;
			right: 0rpx;
		}

		.wtxq_fd1_0_c0_c1_c1_higd {
			position: absolute;
			right: 0rpx;
			z-index: 3;
			width: 116rpx;
			height: 48rpx;
			font-size: 24rpx;
			color: var(--benbenFontColor3);
			text-align: center;
		}

		.wtxq_fd1_0_c0_c1_c1_1_higd {
			position: absolute;
			right: 0rpx;
			z-index: 3;
			width: 116rpx;
			// height: 48rpx;
		}

		.wtxq_fd1_0_c0_c3_higd {
			line-height: 88rpx;

			.wtxq_fd1_0_c0_c3_c0_higd {
				width: 170rpx;
			}
		}

		.wtxq_fd1_0_c0_c3_c1_higd {
			color: #333;
		}

		.wtxq_fd1_1_higd {
			background: rgba(255, 255, 255, 1);
			background-size: 100% auto;
			margin: 0rpx 32rpx 0rpx 32rpx;

			.wtxq_fd1_1_c0_higd {
				line-height: 88rpx;
				padding: 0rpx 0rpx 0rpx 24rpx;
			}

			.wtxq_fd1_1_c1_c0_higd {
				padding: 0rpx 24rpx 0rpx 24rpx;
				margin: 0rpx 0rpx 32rpx 0rpx;
				background: rgba(255, 255, 255, 1);
				background-size: 100% auto;
				border-radius: 16rpx;
				border-bottom: 1px solid #eee;

				.wtxq_fd1_1_c1_c0_c1_higd {
					line-height: 66rpx;

					.wtxq_fd1_1_c1_c0_c1_c0_higd {
						color: rgba(153, 153, 153, 1);
						font-size: 24rpx;
					}
				}
			}
		}

		.wtxq_fd1_1_c0_c0_higd {
			color: #333;
			font-size: 32rpx;
			font-weight: 500;
		}

		.wtxq_fd1_1_c1_c0_c0_c1_c0_higd {
			height: 40rpx;

			.wtxq_fd1_1_c1_c0_c0_c1_c0_c0_higd {
				height: 40rpx;
				line-height: 40rpx;
				color: var(--benbenFontColor6);
				width: 96rpx;
				text-align: center;
				font-size: 24rpx;
				border: 1px solid rgba(255, 140, 0, 1);
				border-radius: 8rpx;
			}

			.wtxq_fd1_1_c1_c0_c0_c1_c0_c0_1_higd {
				color: rgba(255, 255, 255, 1);
				height: 40rpx;
				line-height: 40rpx;
				background: rgba(68, 141, 247, 1);
				background-size: 100% auto;
				width: 96rpx;
				font-size: 24rpx;
				text-align: center;
				border-radius: 8rpx;
			}
			.numbers{
				height: 40rpx;
				line-height: 40rpx;
				color: var(--benbenFontColor6);
				width: 96rpx;
				text-align: center;
				font-size: 24rpx;
			}
		}

		.wtxq_fd1_1_c1_c0_c0_c1_c1_c0_higd {
			line-height: 40rpx;
			height: 40rpx;
			font-size: 24rpx;
			color: var(--benbenFontColor6);
			text-align: center;
			width: 96rpx;
			border: 1px solid var(--benbenbdColor3);
			border-radius: 8rpx;
		}

		.wtxq_fd1_1_c1_c0_c0_c1_c1_c0_1_higd {
			color: rgba(235, 149, 75, 1);
			border: 1px solid rgba(235, 149, 75, 1);
			height: 40rpx;
			line-height: 40rpx;
			width: 96rpx;
			text-align: center;
			font-size: 24rpx;
			border-radius: 8rpx;
		}

		.wtxq_fd1_1_c1_c0_c0_c1_c2_c0_higd {
			line-height: 40rpx;
			height: 40rpx;
			color: rgba(235, 149, 75, 1);
			font-size: 24rpx;
			text-align: center;
			width: 96rpx;
			border: 1px solid var(--benbenbdColor3);
			border-radius: 8rpx;
		}

		.wtxq_fd1_1_c1_c0_c0_c1_c2_c0_1_higd {
			color: var(--benbenFontColor3);
			height: 40rpx;
			line-height: 40rpx;
			background: rgba(68, 141, 247, 1);
			background-size: 100% auto;
			width: 96rpx;
			font-size: 24rpx;
			text-align: center;
			border-radius: 8rpx;
		}

		.wtxq_flex_0_higd {
			width: 750rpx;
			height: 88rpx;
			overflow: hidden;
			z-index: 10;
			top: 0rpx;
			background: #fff;
			background-size: 100% auto !important;

			.wtxq_fd0_0_higd {
				padding: 0rpx 32rpx 0rpx 32rpx;
			}
		}

		.wtxq_fd0_0_c0_higd {
			// width: 120rpx;

			.wtxq_fd0_0_c0_c0_higd {
				font-size: 36rpx;
				color: #333;
			}
		}

		.wtxq_fd0_0_c1_c0_higd {
			font-size: 36rpx;
			font-weight: 700;
			color: #333333;
			line-height: 50rpx;
		}
	}
.saomabox{
		position: fixed;
		width: 100%;
		height: 100%;
		align-items:center;
	
		// justify-content: center;
		z-index: 999;
		// background-color: rgba(238, 238, 238, 0.8);
	}
	.scan-container {
	 //  width: 300px;
	 //  height:300px;
	 // // margin: 0 auto;
	 //  border: 1px solid #eee;
	 //  background-color: red;
	  width: 70vw; /* 宽度为视窗宽度的70% */
		aspect-ratio: 1/1;
	    // aspect-ratio: 3/4; /* 关键：保持1:1比例 */
	    // max-width: 400px; /* 最大宽度限制 */
	    // margin: 20px auto;
	    // border: 2px solid #07C160;
	    border-radius: 8px;
	    overflow: hidden;
	    position: relative;
		text-align: center;
		justify-content: center;
	    background:  rgba(0, 0, 0, 1); /* 视频背景为黑色 */
		margin-top: 300rpx;
	}
</style>
